package main

import (
	"fmt"
	"os"
	"path/filepath"
)

func scan(path string, f os.FileInfo, err error) error {
	fmt.Println("Scanned:", path)
	return nil
}

func main() {
	root := `cp6_file/dir/test_walk`
	//walk函数遍历文件夹，会递归遍历子文件
	err := filepath.Walk(root, scan)
	if err != nil {
		fmt.Println(err)
	}
}
